/* main styles */
*, *:before, *:after {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 100%;
  font-size: calc(1em + 0.3vw);
  font-weight: 300;
  line-height: 1.4;
  color: #444;
  background-color: #eee;
  overflow-x: hidden;
  overflow-y: scroll;
}

main {
  display: block;
  padding-bottom: 2em;
  background-color: #fff;
}

header, article, footer, #menu {
  clear: both;
  display: block;
  position: relative;
  max-width: 50rem;
  padding: 0 4vw;
  margin: 0 auto;
}

/* header */
.logo {
  display: block;
  width: 15vw;
  max-width: 152px;
}

.logo img {
  display: block;
}

.logo:hover img {
  animation: ring 0.1s ease-in infinite;
}

/* footer */
footer {
  clear: both;
  padding-top: 2em;
  padding-bottom: 2em;
}

footer p {
  font-size: 0.7em;
  font-weight: 400;
  text-align: center;
  margin: 0;
}

/* menu link */
#menu {
  position: fixed;
  display: block;
  top: 0;
  left: 0;
  right: 0;
  margin-left: calc((100% - 50rem) / 2);
  pointer-events: none;
}

#menu a {
  display: block;
  float: right;
  font-size: 1.2em;
  font-weight: 600;
  text-align: right;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 2;
  padding: 0 0.6em;
  margin: 0.2em;
  color: #444;
  background-color: rgba(255,255,255,0.6);
  border: 2px solid #444;
  border-radius: 0.2em;
  pointer-events: all;
}

#menu a:before {
  display: inline-block;
  content: '\2261';
  font-size: 1.2em;
  line-height: 1;
  margin-right: 0.2em;
}

#menu a:hover, #menu a:focus, #menu a:active {
  color: #fff;
  background-color: #00c;
  border-color: #fff;
  outline: 0 none;
}

/* navigation */
#nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0,0,0,0.9);
  will-change: transform;
  transform-origin: 50% 0;
  transform: scaleY(0);
}

#nav:target {
  animation: navopen 0.4s ease-out 0s 1 forwards;
}

#menu:target ~ #nav {
  animation: navclose 0.3s ease-in 0s 1 forwards;
}

#nav ul {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#nav li {
  flex: 1 1 auto;
  display: flex;
  padding: 0;
  margin: 0;
}

#nav a {
  display: block;
  flex: 1 1 100%;
  font-size: 10vh;
  text-align: center;
  text-transform: none;
  text-decoration: none;
  padding: 2vh 5vw 0 5vw;
  color: #fff;
  will-change: transform;
  transition: transform 0.2s ease-in-out;
  transform: scale(1) rotate(0);
}

#nav a.nav:hover, #nav a.nav:focus {
  transform: scale(1.3);
}

#nav a.active {
  font-weight: 400;
  color: #999;
}

#nav a.close {
  text-align: right;
}

/* article styles */
h1 {
  position: absolute;
  top: 1em;
  font-size: 1.8em;
  font-size: calc(1.4em + 2vw);
  font-weight: bold;
  width: 8em;
  max-width: 100%;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 1px #000;
}

h2 {
  font-weight: normal;
  margin-top: 1.5em;
}

p {
  margin-top: 1em;
}

h2 + p {
  margin-top: 0;
}

ul, ol {
  margin: 1em 0 1.5em 3em;
}

li {
  margin-top: 0.5em;
}

img {
  max-width: 100%;
  border: 0 none;
}

figure {
  text-align: center;
  padding-bottom: 6px;
  margin: 1em 0 1.5em 0;
  border-bottom: 5px solid #ddd;
}

figcaption {
  display: inline-block;
  font-weight: 400;
  font-style: italic;
  font-size: 1.1em;
  text-align: left;
  line-height: 1.1;
  margin-top: 0.2em;
  color: #555;
}

@media (min-width: 60rem) {

  .boxout1, .boxout2 {
    clear: both;
    float: left;
    width: 75%;
    padding: 0 10px 10px 0;
    margin: 1em 1em 1.5em -10vw;
    border: 0 none;
    border-right: 5px solid #ddd;
  }

  .boxout2 {
    float: right;
    padding: 0 0 10px 10px;
    margin: 1em -10vw 1.5em 1em;
    border-left: 5px solid #ddd;
    border-right: 0 none;
  }

}

.primary {
  width: 100vw;
  left: 50%;
  max-height: 50vh;
  padding: 0;
  margin: 0 0 0 -50vw;
  border: 0 none;
}

/* progressive image CSS */
.progressive {
  position: relative;
  display: block;
  overflow: hidden;
  outline: none;
}

.progressive:not(.replace) {
  cursor: default;
}

.progressive img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  border: 0 none;
}

.progressive img.preview {
  filter: blur(2vw);
  transform: scale(1.05);
}

.progressive img.reveal {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
  animation: reveal 1s ease-out;
}

/* animation keyframes */
@keyframes ring {
  0% { transform: rotate(0deg); }
  33% { transform: rotate(5deg); }
  66% { transform: rotate(-5deg); }
}

@keyframes navopen {
  0% { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

@keyframes navclose {
  100% { transform: scaleY(0); }
  0% { transform: scaleY(1); }
}

@keyframes reveal {
	0% { transform: scale(1.05); opacity: 0; }
	100% { transform: scale(1); opacity: 1; }
}
